<?php
include 'common.php';

if ($user->hasLogin()) {
    $response->redirect($options->adminUrl);
}
$rememberName = htmlspecialchars(Typecho_Cookie::get('__typecho_remember_name'));
Typecho_Cookie::delete('__typecho_remember_name');

$bodyClass = 'body-100';

include 'header.php';
?>
    <div uk-height-viewport class="uk-flex uk-flex-middle">
        <div class="uk-width-2-3@m uk-width-1-2@s m-auto rounded uk-overflow-hidden shadow-lg">
            <div class="uk-child-width-1-2@m uk-grid-collapse bg-gradient-primary" uk-grid>

                <!-- column one -->
                <div class="uk-margin-auto-vertical uk-text-center uk-animation-scale-up p-3 uk-light">
                    <img src="assets/images/logo-light-icon.png" alt="">
                    <h3 class="mb-3 mt-lg-4">OYO</h3>
                    <p>OYO模板</p>
                </div>

                <!-- column two -->
                <div class="uk-card-default px-5 py-8">
                    <div class="mb-4 uk-text-center">
                        <h2 class="mb-0">登录</h3>
                        <p class="my-2">登录到您的ID来管理您的博客</p>
                    </div>
                    <form action="<?php $options->loginAction(); ?>" method="post" name="login" role="form">

                        <div class="uk-form-group">
                            <label for="name" class="uk-form-label"><?php _e('用户名'); ?></label>

                            <div class="uk-position-relative w-100">
                                <span class="uk-form-icon">
                                    <i class="icon-feather-user"></i>
                                </span>
                                <input id="name" name="name" class="uk-input" type="text" value="<?php echo $rememberName; ?>" placeholder="<?php _e('用户名'); ?>" autofocus />
                            </div>

                        </div>

                        <div class="uk-form-group">
                            <label for="password" class="uk-form-label"><?php _e('密码'); ?></label>

                            <div class="uk-position-relative w-100">
                                <span class="uk-form-icon">
                                    <i class="icon-feather-lock"></i>
                                </span>
                                <input class="uk-input" id="password" type="password" name="password" placeholder="<?php _e('密码'); ?>">
                            </div>

                        </div>
                        <div class="mt-4 uk-flex-middle uk-grid-small" uk-grid>
                            <div class="uk-width-expand@s">
                                <p> 还没有账号吗？ <a href="<?php $options->registerUrl(); ?>">点击注册</a></p>
                            </div>
                            <div class="uk-width-auto@s">
                                <button type="submit" class="button primary" ><?php _e('登录'); ?></button>
								<input type="hidden" name="referer" value="<?php echo htmlspecialchars($request->get('referer')); ?>" />
                            </div>
                        </div>
                    </form>
                </div><!--  End column two -->

            </div>
        </div>
    </div>

    <!-- Content -End
    ================================================== -->


     

    <!-- javaScripts
    ================================================== -->
    <script src="assets/js/uikit.js"></script>
    <script src="assets/js/simplebar.js"></script>
<?php 
include 'common-js.php';
?>
<script>
$(document).ready(function () {
    $('#name').focus();
});
</script>
<?php
include 'footer.php';
?>
